package com.mq;


import java.util.Vector;


/**
 * @author ChengNing
 * @date   2012-9-27
 */
public class MsgQueue<E>{
	
	private Vector<E> queue;
	
	private MsgQueue() {
	}
	
//	public static MsgQueue getQueue(){
//		//return queue;
//	}
	
	/**
	 * @param element
	 */
	public synchronized void push(E element) {
		queue.add(element);
	}
	
	/**
	 * @return
	 */
	public synchronized E pop(){
		if(queue.size() == 0)
			return null;
		E e = queue.firstElement();
		queue.remove(0);
		return e;
	}
	
	public static void main(){
		//MsgQueue<String> queue = new 
	}

}
